<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件委托获取点击对象的index</title>
</head>
<body>
<ul id="parent">
    <li>01</li>
    <li>02</li>
    <li>03</li>
    <li>04</li>
    <li>05</li>
</ul>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>
    let element = document.querySelector("#parent");
    element.addEventListener('click',function (event) {
        console.log($(event.target).index());
    },false);
</script>
</body>
</html>
